/**
 * 
 */
package com.qdairlines.service.file.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qdairlines.common.Page;
import com.qdairlines.dao.file.FastDFSFileMapper;
import com.qdairlines.entity.file.FastDFSFile;
import com.qdairlines.service.file.FileAdminService;

/**
 * @author pangyannan
 * @date 2017年6月5日
 * @company QingDao Airlines
 * @description
 */
@Service
public class FileAdminServiceImpl implements FileAdminService {
	@Autowired
	private FastDFSFileMapper fastDFSFileMapper;

	@Override
	public Page listDate(FastDFSFile fastDFSFile,Page page) {
		PageHelper.startPage(page.getPageNumber(), page.getPageSize());
		List<FastDFSFile> list = fastDFSFileMapper.selectByQuery(fastDFSFile);
		PageInfo<FastDFSFile> pageInfo = new PageInfo<FastDFSFile>(list);
		page.setTotal(String.valueOf(pageInfo.getTotal()));
		page.setRows(pageInfo.getList());
		return page;
	}

}
